package com.xiaoyu.web;


import com.xiaoyu.bootdemo.BlogProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class HelloController {

    @Autowired
    BlogProperties blogProperties;

    @RequestMapping("/")
    public String index(ModelMap map){
        map.addAttribute("host","http://blog.didispace.com");
        return "thymeleaf";
    }

    @RequestMapping("/hello")
    public String hello(){
        return blogProperties.getAll();
    }

    @RequestMapping("/test")
    public String test() throws Exception {
        throw new Exception("1111");
    }
}
